<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCarAdminTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
//        `id` int(11) NOT NULL AUTO_INCREMENT,

//  `user_name` varchar(30) DEFAULT NULL,
//  `nick_name` varchar(30) DEFAULT NULL COMMENT '昵称',
//  `password` varchar(100) DEFAULT NULL,
//  `avatar` varchar(300) DEFAULT NULL COMMENT '用户头像',
//  `email` varchar(100) DEFAULT NULL COMMENT '邮箱',

        Schema::create('admin', function (Blueprint $table) {

            $table->increments('id');

            $table->string('user_name',30);
            $table->string('nick_name',30);
            $table->string('mobile',11)->unique();
            $table->string('password',100);
            $table->string('email',100);
            $table->char('last_ip', 15)->default('')->comment('登录IP');
            $table->enum('status', [0,1])->default(0)->comment('用户状态,0封禁1有效');
            $table->timestamps();
            $table->softDeletes();


        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin');
    }
}
